import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('AutoRotateAnim')
export class AutoRotateAnim extends Component {

    @property
    spd = 90;
    @property
    isClearAng = false;

    angY = 0;
    protected onEnable(): void {
        if (this.isClearAng) {
            this.angY = 0;
        }
        this.angY = this.angY % 360;
    }
    update(dt: number) {
        this.angY += dt * this.spd;
        this.node.angle = this.angY;
    }

}

